package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface RoleDao {

    public Set<Role> findByUserId(int id);

    Page<Role> findAllRole(@Param("queryString") String queryString);

    void addRole(Role role);

    void setRoleAndPermission(@Param("roleId")Integer roleId,@Param("permissions") Integer[] permissions);

    void setRoleAndMenu(@Param("roleId")Integer roleId,@Param("menus")Integer[] menus);

    void deleteRole(Integer id);

    void deleteAndPermission(Integer id);

    void deleteAndMenu(Integer id);


    //查询全部
    public List<Role> findAll();

    //根据userId查询roleIds
    public List<Integer> findUserIdByroleids(int id);

}
